package com.lgqx.springsecurity.common.exception;

import com.lgqx.springsecurity.common.api.ApiCode;
import lombok.Data;

/**
 * 自定义异常类
 *
 * @author zhaoz
 */
@Data
public class BusinessException extends RuntimeException {

    /**
     * 异常码
     */
    private int code;

    /**
     * 异常信息
     */
    private String msg;

    public BusinessException(ApiCode apiCode) {
        super(apiCode.getMsg());
        this.code = apiCode.getCode();
        this.msg = apiCode.getMsg();
    }
}



